Tootsville::Infinity-End-Event

Function

Infinity-End-Event names a function, with lambda list (D USER RECIPIENT/S):

Attempt to end an event.

End an event begun by TOOTSVILLE INFINITY-START-EVENT, q.v.

End an event begun by TOOTSVILLE INFINITY-START-EVENT, q.v.

Lisp END-EVENT = JSON endEvent

Calling

{ c: "endEvent",
  d: { moniker: "event moniker",
       ( id | eventID ): "event ID",
       status: ( "cmp" | "cxl" ),
       [ medal: "medal", ]
       [ score: "score" ] } }

This command terminates an event (such as a fountain, store purchase, or minigame) which was begun with TOOTSVILLE INFINITY-START-EVENT, qv.

The parameter eventID can be referenced as id instead --- but that is deprecated (since Romance 1.0) and will (eventually) be dropped.

The status code is either cmp, if the event was completed in some way (successfully or otherwise), or cxl, if the event was canceled before it reached any ind of completion.

The score and medal parameters are optional, and depend on the type of event. They should never be submitted with a cxl cancel packet, and are not needed for an item purchase. They are sometimes to be used with minigames. The score has a special relationship with magic fountains, described below.

Success Response to Canceled Event

The response to a canceled (status: "cxl") event will be of the form:

{ from: "endEvent",
  status: true,
  ended: "eventID",
  canceled: true }

Success Response to Completed Event

The response to a completed (status: "cmp") event will be of the form:

{ from: "endEvent",
  status: true,
  ended: "eventID",
  peanuts: peanuts,
  fairyDust: fairyDust,
  [ highScores: { 1: { points: points,
                       userName: "user name" },
                  2: ... 24: }, ]
  totalPeanuts: total,
  totalFairyDust: total,
  [ gotHighScore: index ]

The endEvent packet for a completed event indicates:

Error Responses

An error response is of the form:

{ from: "endEvent",
  status: false,
  eventID: "event UUID",
  err: "error code",
  error: "User-visible error message" }

The error code can be one of:

cost
The item to be purchased costs more peanuts than you have.

badStatus
The status passed was not one of cmp nor cxl

eventID.notFound
The event ID passed was not found

eventID.notYours
The event ID passed represents an event started by another player

medal.notFound
The medal passed was not valid

score.range
The score reported was not valid; it was not in the range of possible scores for this event.

Changes from 1.2 to 2.0

WRITEME

File

Defined in file src/infinity/legacy-commands.lisp.